package com.yonyou.pmclouds.siteinspection.process;

import com.yonyou.pmclouds.basecom.bp.processor.SingleProcessor;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.siteinspection.entity.SiteInspectionVO;
import org.apache.commons.lang3.StringUtils;

public class SiteInspectionBeforeAddProcess implements SingleProcessor<SiteInspectionVO> {

    @Override
    public void process(SiteInspectionVO vo, SiteInspectionVO orig) throws BusinessException {
        if(vo == null) {
            throw new BusinessException("新增现场检查单为空,请检查!");
//        } else if(StringUtils.isEmpty(vo.getPk_constructionunit())) {
//            throw new BusinessException("施工单位为空");
        } else if(StringUtils.isEmpty(vo.getInspectarea())) {
            throw new BusinessException("检查部位为空");
        } else if(StringUtils.isEmpty(vo.getPk_inspectstandard())) {
            throw new BusinessException("检查标准为空");
        }
        // 设置单据类型...   不再设置单据类型，由前端传递
//        vo.setBill_type(BillTypeConst.SITEINSPECTION_BILLTYPE);
    }

}
